<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> 伪类选择器 </title>
    <style>
        ul li{
            color:#999;
        }

        ul li:first-child{
            color: red;
        }

        ul li:last-child{
            color: blue;
        }

        ul li:nth-child(4){
            color: green ;
        }

/* 偶数even 奇数odd */
        ul li:nth-child(even){
           background-color: coral;
        }
    </style>
</head>
<body>
    <ul>
        <li>元素1</li>
        <li>元素2</li>
        <li>元素3</li>
        <li>元素4</li>
        <li>元素5</li>
        <li>元素6</li>
        <li>元素7</li>
        <li>元素8</li>
        <li>元素9</li>
    </ul>
</body>
</html>